Øyvind Kolås [Sat, 19 Nov 2016 18:38:14 +0000 (19:38 +0100)]
fast-float: fix regression introduced when reindenting
Øyvind Kolås [Sat, 19 Nov 2016 18:22:10 +0000 (19:22 +0100)]
remove babl-fish-stats
Øyvind Kolås [Sat, 19 Nov 2016 17:50:27 +0000 (18:50 +0100)]
gegl-fixups: indentation
Øyvind Kolås [Sat, 19 Nov 2016 17:50:11 +0000 (18:50 +0100)]
fast-float: indentation
Øyvind Kolås [Sat, 19 Nov 2016 17:14:11 +0000 (18:14 +0100)]
remove bablfishpath
Øyvind Kolås [Sat, 19 Nov 2016 14:29:48 +0000 (15:29 +0100)]
cairo: reorder memory reads to be linear
Øyvind Kolås [Sat, 19 Nov 2016 14:21:20 +0000 (15:21 +0100)]
fast-float: improve memory access order
Øyvind Kolås [Sat, 19 Nov 2016 14:01:14 +0000 (15:01 +0100)]
remove babl_process_cost
Øyvind Kolås [Sat, 19 Nov 2016 12:29:36 +0000 (13:29 +0100)]
extension/fast-float: gain some speed by ignoring a couple high mantissa bits
Øyvind Kolås [Sat, 19 Nov 2016 12:28:35 +0000 (13:28 +0100)]
extensions/cairo: remove ; now unused; LUT
Øyvind Kolås [Sat, 19 Nov 2016 11:07:40 +0000 (12:07 +0100)]
fast-float: make float to cairo conversion take clipping into account
Øyvind Kolås [Wed, 16 Nov 2016 19:34:05 +0000 (20:34 +0100)]
babl-fish-path: add some specific conversion targeted debug info
Øyvind Kolås [Wed, 16 Nov 2016 19:40:58 +0000 (20:40 +0100)]
tools: add babl-verify start of an development aid when improving fast paths
This tool take the names of source/target formats - and prints error/cost for
all direct conversions matching arguments.
Øyvind Kolås [Fri, 18 Nov 2016 22:38:12 +0000 (23:38 +0100)]
fast-float: implement linear interpolation in LUT
Øyvind Kolås [Thu, 17 Nov 2016 12:09:54 +0000 (13:09 +0100)]
extensions/gggl-lies: bump up accuracy of a conversion
Øyvind Kolås [Wed, 16 Nov 2016 21:39:17 +0000 (22:39 +0100)]
fast-float: use higher accuracy LUTs and rework some alpha handling
Øyvind Kolås [Wed, 16 Nov 2016 22:52:26 +0000 (23:52 +0100)]
cairo: pad with 255 instead of copy of color for 24bit format
Øyvind Kolås [Wed, 16 Nov 2016 22:19:46 +0000 (23:19 +0100)]
cairo: slight improvements to speed and accuracy
Øyvind Kolås [Wed, 16 Nov 2016 22:11:15 +0000 (23:11 +0100)]
extensions/cairo: remove some arithmetic
Øyvind Kolås [Wed, 16 Nov 2016 19:36:57 +0000 (20:36 +0100)]
change default BABL_TOLERANCE to 0.000006
This makes the cairo.so extensions fast path for RGBA float blitting to be
accepted. This makes conversions with internal quantization of roughly 16bit be
accepted.
Øyvind Kolås [Wed, 16 Nov 2016 18:27:28 +0000 (19:27 +0100)]
extensions/cairo: replace hard-coded LUT with runtime LUT
The LUT needed recomputation anyways, doing it at runtime permits easier
tweaking. This results in better precision for the fast path than the
existing table.
Øyvind Kolås [Wed, 16 Nov 2016 16:42:33 +0000 (17:42 +0100)]
add single precision versions of linear/gamma conversions
Øyvind Kolås [Wed, 16 Nov 2016 16:12:50 +0000 (17:12 +0100)]
fast-float: tweak lut generation
Øyvind Kolås [Tue, 15 Nov 2016 22:51:44 +0000 (23:51 +0100)]
babl-cache: attempt to make things barely compile on win32
Øyvind Kolås [Tue, 15 Nov 2016 16:02:10 +0000 (17:02 +0100)]
store cached fishes in ~/.cache/babl
Still no fish cache path solution for win32
Øyvind Kolås [Tue, 15 Nov 2016 14:50:52 +0000 (15:50 +0100)]
babl-cache: remove unneeded switch
Øyvind Kolås [Tue, 15 Nov 2016 14:47:58 +0000 (15:47 +0100)]
reduce default max babl path to 3
Big decrease in combinatorial explosion of search - missing out on some big
fish.
Øyvind Kolås [Tue, 15 Nov 2016 13:50:01 +0000 (14:50 +0100)]
babl-cache: add a 1% probability of cached conversions being dropped on load
Øyvind Kolås [Tue, 15 Nov 2016 13:22:48 +0000 (14:22 +0100)]
babl-cache: store tolerance as part of cache versioning
Øyvind Kolås [Tue, 15 Nov 2016 12:05:28 +0000 (13:05 +0100)]
move fish cache to own .c file
Simon Budig [Tue, 15 Nov 2016 01:34:27 +0000 (02:34 +0100)]
extensions: align rounding of R'G'B'A u8 -> cairo-ARGB32 with reference conversion
SBP [Fri, 11 Nov 2016 23:14:38 +0000 (17:14 -0600)]
Add extension with HCY color model, and pixel formats
Øyvind Kolås [Mon, 14 Nov 2016 23:33:41 +0000 (00:33 +0100)]
babl.db: do not use strtod - it is locale dependent
Øyvind Kolås [Mon, 14 Nov 2016 21:09:00 +0000 (22:09 +0100)]
remove deprecated loss struct member
Øyvind Kolås [Mon, 14 Nov 2016 19:47:39 +0000 (20:47 +0100)]
babl.db: if git hash has changed, drop cache
Øyvind Kolås [Mon, 14 Nov 2016 19:42:16 +0000 (20:42 +0100)]
babl.db: store git rev/version in header
Øyvind Kolås [Mon, 14 Nov 2016 17:01:55 +0000 (18:01 +0100)]
build: add generation of git-version.h
Øyvind Kolås [Mon, 14 Nov 2016 17:39:16 +0000 (18:39 +0100)]
fish cache: sort cached fish paths by descending usage
Øyvind Kolås [Mon, 14 Nov 2016 16:18:36 +0000 (17:18 +0100)]
babl-fish-path: do not allow parallell construction
Øyvind Kolås [Mon, 14 Nov 2016 13:28:31 +0000 (14:28 +0100)]
babl_init_db: formats being with first char of line
Øyvind Kolås [Mon, 14 Nov 2016 01:30:03 +0000 (02:30 +0100)]
bail on db-cache restoration if format lookup fails
Øyvind Kolås [Sun, 13 Nov 2016 23:45:15 +0000 (00:45 +0100)]
babl: cache state between babl runs
Store the contents of discovered babl_paths between runs, for now in
/tmp/babl.db , should move to a per-user dir to make it survive reboots.
The code should also check a versioning string at the start and bail if there
is any mismatch... since the data should be reconstructable; and more reliable
when reconstructed than a possibly old version.
Alexandre Prokoudine [Sat, 5 Nov 2016 17:22:41 +0000 (20:22 +0300)]
Post-release version bump to 0.1.21
Alexandre Prokoudine [Sat, 5 Nov 2016 17:14:55 +0000 (20:14 +0300)]
Release 0.1.20
Alexandre Prokoudine [Sat, 5 Nov 2016 17:12:12 +0000 (20:12 +0300)]
Update NEWS for 0.1.20
Roman Lebedev [Mon, 22 Aug 2016 17:24:14 +0000 (20:24 +0300)]
extensions: fast-float: add destroy() callback, fix 2 leaks
Fixes these 2 not-so-informative leaks, every test showed them:
=================================================================
==27868==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 540276 byte(s) in 1 object(s) allocated from:
0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
1 0x7f9cdd208cbb (<unknown module>)
2 0x7f9cdd207cca (<unknown module>)
3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)
Direct leak of 540276 byte(s) in 1 object(s) allocated from:
0 0x4cf190 in calloc (/home/lebedevri/src/_GIMP/babl/tests/.libs/nop+0x4cf190)
1 0x7f9cdd208cbb (<unknown module>)
2 0x7f9cdd207cf6 (<unknown module>)
3 0x7f9ce06820d8 in babl_extension_load /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:221:7
4 0x7f9ce06819d6 in babl_extension_load_dir /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:263:19
5 0x7f9ce06813fa in babl_extension_load_dir_list /home/lebedevri/src/_GIMP/babl/babl/babl-extension.c:333:17
6 0x7f9ce0678c84 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:151:7
#7 0x50504a in main /home/lebedevri/src/_GIMP/babl/tests/nop.c:26:3
8 0x7f9cdf64e72f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2072f)
SUMMARY: AddressSanitizer:
1080552 byte(s) leaked in 2 allocation(s).
Øyvind Kolås [Tue, 30 Aug 2016 22:32:02 +0000 (00:32 +0200)]
babl-extension: fix BABL_PATH debug warning
Øyvind Kolås [Tue, 30 Aug 2016 22:17:24 +0000 (00:17 +0200)]
babl-extension: print warning if no extensions were loaded
Roman Lebedev [Fri, 26 Aug 2016 10:16:51 +0000 (13:16 +0300)]
babl_fish_path_fitness: gcc6: fix -Wmisleading-indentation warnings
Roman Lebedev [Mon, 22 Aug 2016 12:25:31 +0000 (15:25 +0300)]
tools: babl-gen-test-pixels: add explicit return 0
Gcc-4.9 warns:
babl-gen-test-pixels.c: In function ‘main’:
babl-gen-test-pixels.c:170:1: error: control reaches end of non-void function [-Werror=return-type]
Roman Lebedev [Sun, 21 Aug 2016 11:08:37 +0000 (14:08 +0300)]
extensions: gegl-fixups: mark unused functions with attribute
Roman Lebedev [Sun, 21 Aug 2016 08:49:26 +0000 (11:49 +0300)]
Babl-fish-reference: create_name_internal(): ooops, should return int
I broke it in
0fe22e1e37197ef6112645bf5a136580c0927a1e
and totally did not even notice the warning...
Roman Lebedev [Fri, 19 Aug 2016 17:05:17 +0000 (20:05 +0300)]
extensions: gggl: conv_rgb8_rgba8(): use 255UL, not 255
Fixes:
gggl.c:758:62: runtime error: left shift of 255 by 24 places cannot be represented in type 'int'
Roman Lebedev [Fri, 19 Aug 2016 17:04:59 +0000 (20:04 +0300)]
extensions: fast-float: babl_lookup(): use 1UL, not just 1
Fixes:
fast-float.c:81:35: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
and
fast-float.c:91:34: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Roman Lebedev [Fri, 19 Aug 2016 12:23:02 +0000 (15:23 +0300)]
babl_fish_reference(), create_name(): add conditional fastpath.
Using __thread keyword.
Although, it is probably not universally avaliable, so this
is just conditional fastpath, if it is detected as unsupported
at compile time, the dumb implementation using malloc() is used.
Roman Lebedev [Fri, 19 Aug 2016 18:01:03 +0000 (21:01 +0300)]
babl_fish_reference(), create_name() are racy
create_name_internal() uses global static buffer to create name.
While this is definitely fast, it can't work concurrently.
I used snprintf()+malloc()+snprintf(), so the amount of allocated
memory for the string is optimal.
Alternatively, a mutex would solve the problem, not sure which
solution is faster / better.
Roman Lebedev [Thu, 18 Aug 2016 11:01:51 +0000 (14:01 +0300)]
Add .kateconfig with modelines for Kate
Directly follows GIMP HACKING Hackordnung:
- 2 characters indentation level
- no tabs. TAB should not put TAB characters in the file.
- tab stops at 8 column intervals.
Øyvind Kolås [Wed, 15 Jun 2016 05:20:36 +0000 (07:20 +0200)]
post release version bump to 0.1.19
Alexandre Prokoudine [Sun, 12 Jun 2016 23:07:53 +0000 (02:07 +0300)]
Release 0.1.18
Massimo Valentini [Mon, 30 May 2016 10:45:44 +0000 (12:45 +0200)]
Bug 764628: Gaussian blur: visual glitches
Øyvind Kolås [Fri, 12 Feb 2016 14:27:10 +0000 (15:27 +0100)]
post release bump
Øyvind Kolås [Fri, 12 Feb 2016 14:25:42 +0000 (15:25 +0100)]
release 0.0.16
Øyvind Kolås [Fri, 12 Feb 2016 11:05:33 +0000 (12:05 +0100)]
extensions: re-add table based conversions inherited from gggl
This code was replaces with the exact code paths in gggl and gggl-lies,
adding these new extensions re-enables the ability to use these
slightly less exact conversions - that possibly also could be fixed
to be exact.
Massimo Valentini [Tue, 19 Jan 2016 18:07:19 +0000 (19:07 +0100)]
zero initialize lsb
Øyvind Kolås [Mon, 18 Jan 2016 22:37:09 +0000 (23:37 +0100)]
extensions: remove inaccurate table based conversions
If desired - the table based fast paths should be re-added as separate
extensions.
Massimo Valentini [Sat, 16 Jan 2016 18:33:25 +0000 (19:33 +0100)]
base: half-float reference zero initialize lsb
Øyvind Kolås [Sat, 16 Jan 2016 11:08:06 +0000 (12:08 +0100)]
base: remove commented out single/half code
Øyvind Kolås [Sat, 16 Jan 2016 11:07:21 +0000 (12:07 +0100)]
extensions: add single to/from half float extension
Øyvind Kolås [Sat, 16 Jan 2016 10:16:22 +0000 (11:16 +0100)]
base: fix half reference conversion expecting zeroed target
As discovered in bug #760703 the reference path is currently expecting
zeroed memory, fix by explicitly zeroing last 32bit of mantissa.
Øyvind Kolås [Sun, 10 Jan 2016 23:42:42 +0000 (00:42 +0100)]
sse2: reuse linear premul/unpremul for gamma formats
Debarshi Ray [Sat, 9 Jan 2016 18:41:29 +0000 (19:41 +0100)]
CIE: Add conversion from "RGB float" to "CIE Lab float" and vice versa
Conversions from "RGB float" to "CIE Lab float" are 10 times slower
without this. One use case is passing a "RGB float" buffer to a
saturation operation that works in the "CIE Lab" colour space.
https://bugzilla.gnome.org/show_bug.cgi?id=760310
Daniel Sabo [Fri, 8 Jan 2016 02:05:44 +0000 (18:05 -0800)]
Fix AVX instructions being generated in SSE4.1 code (bug #760292)
The half-float flag got accidentally added to the SSE4.1 flags,
causing GCC to auto-enable AVX.
Michael Henning [Mon, 4 Jan 2016 00:00:29 +0000 (19:00 -0500)]
extensions: Only build sse-half for x86_64.
_mm_insert_epi64 is only available on 64-bit
Michael Henning [Sun, 3 Jan 2016 22:02:38 +0000 (17:02 -0500)]
configure.ac: Fix the test for compiling half-floating point code.
_mm_cvtph_ps is implicitly defined if the compiler does not support
it. So, we need to store its return value in a variable so that
the test fails to type check when the function is implicitly defined
to return an int.
Daniel Sabo [Sun, 27 Dec 2015 15:29:55 +0000 (07:29 -0800)]
Add support for hardware half<->float conversions
These instructions require a Ivy Bridge or newer processor, so I've only
been able to test them under the Intel Software Development Emulator.
Daniel Sabo [Sun, 20 Dec 2015 11:14:19 +0000 (03:14 -0800)]
Add SSE4.1 u8 -> float conversions
Daniel Sabo [Sun, 20 Dec 2015 11:36:51 +0000 (03:36 -0800)]
Add SSE4 to babl-cpuaccel
Øyvind Kolås [Sat, 21 Nov 2015 02:44:13 +0000 (03:44 +0100)]
fix bug 755405
Øyvind Kolås [Thu, 19 Nov 2015 20:26:04 +0000 (21:26 +0100)]
post release version bump
Øyvind Kolås [Thu, 19 Nov 2015 20:05:17 +0000 (21:05 +0100)]
release: 0.1.14
Øyvind Kolås [Thu, 19 Nov 2015 20:05:07 +0000 (21:05 +0100)]
NEWS, AUTHORS: updates
Roman Lebedev [Sat, 13 Jun 2015 13:59:35 +0000 (16:59 +0300)]
babl_format_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==1657==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fd3026d6c20 at pc 0x7fd3026b6e4a bp 0x7fffaac308a0 sp 0x7fffaac30898
READ of size 4 at 0x7fd3026d6c20 thread T0
0 0x7fd3026b6e49 in babl_format_new /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317
1 0x7fd3026bf44f in construct_double_format /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:259
2 0x7fd3026bfd12 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:204
3 0x7fd3026acce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
4 0x7fd3026a9379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
5 0x7fd306e5a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
6 0x7fd301f5d238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
7 0x7fd301f5e193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
8 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
9 0x7fd300f71b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
10 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7fd3026d6c23 is located 0 bytes to the right of global variable '*.LC8' from 'babl-model.c' (0x7fd3026d6c20) of size 3
'*.LC8' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-format.c:317 babl_format_new
Shadow bytes around the buggy address:
0x0ffae04d2d70: f9 f9 f9 f9 00 00 04 f9 f9 f9 f9 f9 00 00 02 f9
=>0x0ffae04d2d80: f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9 00 02 f9 f9
0x0ffae04d2d90: f9 f9 f9 f9 05 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==1657==ABORTING
Roman Lebedev [Sat, 13 Jun 2015 13:57:20 +0000 (16:57 +0300)]
babl_model_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==31464==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f1c25907940 at pc 0x7f1c258f7636 bp 0x7ffdc4838670 sp 0x7ffdc4838668
READ of size 4 at 0x7f1c25907940 thread T0
0 0x7f1c258f7635 in babl_model_new /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114
1 0x7f1c258e4ce5 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:128
2 0x7f1c258e1379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
3 0x7f1c2a0923d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
4 0x7f1c25195238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
5 0x7f1c25196193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
7 0x7f1c241a9b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7f1c25907943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f1c25907940) of size 3
'*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-model.c:114 babl_model_new
Shadow bytes around the buggy address:
0x0fe404b18f10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe404b18f20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
0x0fe404b18f30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==31464==ABORTING
Roman Lebedev [Sat, 13 Jun 2015 13:54:21 +0000 (16:54 +0300)]
babl_component_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==28935==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f6e2393f940 at pc 0x7f6e23919b5f bp 0x7ffc7b9ca770 sp 0x7ffc7b9ca768
READ of size 4 at 0x7f6e2393f940 thread T0
0 0x7f6e23919b5e in babl_component_new /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82
1 0x7f6e2391cbda in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:96
2 0x7f6e23919379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
3 0x7f6e280ca3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
4 0x7f6e231cd238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
5 0x7f6e231ce193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
7 0x7f6e221e1b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7f6e2393f943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f6e2393f940) of size 3
'*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-component.c:82 babl_component_new
Shadow bytes around the buggy address:
0x0fee4471ff10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fee4471ff20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
0x0fee4471ff30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==28935==ABORTING
Roman Lebedev [Sat, 13 Jun 2015 13:50:55 +0000 (16:50 +0300)]
babl_type_new(): fix global-buffer-overflow
If we pass a string into this function, and this string is shorter than
sizeof(Babl), macro BABL_IS_BABL() will read past string bounds,
and bad things may happen.
NOTE: if a string will be passed into this function, that is not
handled by those if (!strcmp (arg, "<...>")), global-buffer-overflow
will still happen. i am not sure if/what can be done about it :(
Fixes following error:
=================================================================
==25849==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f7faec97940 at pc 0x7f7faec8b9bc bp 0x7ffd22ab9210 sp 0x7ffd22ab9208
READ of size 4 at 0x7f7faec97940 thread T0
0 0x7f7faec8b9bb in babl_type_new /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88
1 0x7f7faec74ba9 in babl_core_init /home/lebedevri/src/_GIMP/babl/babl/babl-core.c:90
2 0x7f7faec71379 in babl_init /home/lebedevri/src/_GIMP/babl/babl/babl.c:145
3 0x7f7fb342a3d1 in gegl_post_parse_hook (/usr/local/lib/libgegl-0.3.so.0+0x523d1)
4 0x7f7fae525238 in g_option_context_parse (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x55238)
5 0x7f7fae526193 in g_option_context_parse_strv (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x56193)
6 0x48b8cf in main (/usr/local/bin/gimp-2.9+0x48b8cf)
7 0x7f7fad539b44 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b44)
8 0x486b68 (/usr/local/bin/gimp-2.9+0x486b68)
0x7f7faec97943 is located 0 bytes to the right of global variable '*.LC1' from 'babl-core.c' (0x7f7faec97940) of size 3
'*.LC1' is ascii string 'id'
SUMMARY: AddressSanitizer: global-buffer-overflow /home/lebedevri/src/_GIMP/babl/babl/babl-type.c:88 babl_type_new
Shadow bytes around the buggy address:
0x0ff075d8af10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0ff075d8af20: 05 f9 f9 f9 f9 f9 f9 f9[03]f9 f9 f9 f9 f9 f9 f9
0x0ff075d8af30: 07 f9 f9 f9 f9 f9 f9 f9 07 f9 f9 f9 f9 f9 f9 f9
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Contiguous container OOB:fc
ASan internal: fe
==25849==ABORTING
Øyvind Kolås [Sun, 21 Jun 2015 20:25:41 +0000 (22:25 +0200)]
babl_parse_double: permit 0 and 9 after .
spotted by massimo, before this fix BABL_TOLERANCE < 0.1 and != 0 was not
possible.
Øyvind Kolås [Fri, 29 May 2015 03:05:32 +0000 (05:05 +0200)]
Revert "build: add --enable-installed-tests parameter"
This reverts commit
1457ff4d59f1e2fccdf7e09e5725a698afbc5d22.
Loren Merritt [Fri, 29 May 2015 00:37:26 +0000 (00:37 +0000)]
Fix generation of test pixels
Most of the test data was zeros. Which produced innacurate benchmarks of any
conversion paths whose speed is data-dependent, such as gamma correction.
Vadim Rutkovsky [Thu, 7 Aug 2014 15:39:57 +0000 (17:39 +0200)]
build: add --enable-installed-tests parameter
See https://live.gnome.org/GnomeGoals/InstalledTests for more information.
Those tests will also be executed on http://build.gnome.org
It's still possible to run `make check` with locally uninstalled tests.
Thomas Manni [Wed, 20 May 2015 23:33:54 +0000 (01:33 +0200)]
CIE: minor cleanups
Use macros for kappa, epsilon and D50 reference white in all places
Remove duplicated comments
Thomas Manni [Wed, 20 May 2015 10:12:35 +0000 (12:12 +0200)]
CIE: new conversions to/from "CIE Lab alpha float" and "RGBA float"
Mukund Sivaraman [Wed, 22 Apr 2015 08:10:06 +0000 (13:40 +0530)]
Don't create a mutexattr for each mutex
Mukund Sivaraman [Sun, 19 Apr 2015 19:30:58 +0000 (01:00 +0530)]
Don't repeat the malloc/free function pointer change messages
Mukund Sivaraman [Sun, 12 Apr 2015 15:17:18 +0000 (20:47 +0530)]
Remove unnecessary stat()
Jon Nordby [Wed, 18 Mar 2015 15:19:24 +0000 (16:19 +0100)]
babl-mutex: Local headers first, remove unused
Ensures the feature macros are set for all includes,
and that the public header does not implicitly rely
on any of the headers included in .c file
Jon Nordby [Wed, 18 Mar 2015 11:07:01 +0000 (12:07 +0100)]
babl-mutex: Define _GNU_SOURCE instead of __USE_GNU
__USE_GNU should only be set internally by the libc feature detect macros.
On older Debian-based systems, as used by Heroku cedar-10 stack, this failed
to provide the definition of PTHREAD_MUTEX_RECURSIVE
Mukund Sivaraman [Sun, 1 Mar 2015 10:57:55 +0000 (16:27 +0530)]
Display whether a format is planar
Mukund Sivaraman [Sun, 1 Mar 2015 07:56:05 +0000 (13:26 +0530)]
Support more than 100 formats
Mukund Sivaraman [Thu, 26 Feb 2015 15:03:16 +0000 (20:33 +0530)]
Fix another place where assigned_name can be NULL
Mukund Sivaraman [Thu, 26 Feb 2015 14:51:18 +0000 (20:21 +0530)]
Allow up to (and including) BABL_MAX_COMPONENTS